<!-- head -->
<div class="row wrapper border-bottom white-bg page-heading">
    <div class="col-md-12">
        <ol class="breadcrumb">
            <li><a>主页</a></li>
            <li><a>代理商工单</a></li>
            <li class="active"><strong>新增工单
            </strong></li>
        </ol>
    </div>
</div>

<!-- content-->
<div class="wrapper wrapper-content animated fadeIn"
     ng-controller="workOrderAddCtrl">
    <form class="form-horizontal" id="form1" name="horizontal">
        <div style="background: #fff; padding:50px 0;">
            <div class="form-group">
                <label class="col-sm-2 control-label"><i class="red_req">*</i>工单类型：</label>
                <div class="col-sm-2">
                    <select  name="workTypeId" id="autocomplete-select1" required
                             ng-model="info.workTypeId" ng-options="x.value as x.text for x in nameSelect" ng-change="showDealProcess()"
                             style="width: 100%" chosen chosen-data="nameSelect" >
                    </select>
                </div>
                <div  class="req_mesg" ng-show="horizontal.workTypeId.$dirty && horizontal.workTypeId.$invalid">
                    <span ng-show="horizontal.workTypeId.$error.required">工单类型不能为空</span>
                </div>
            </div>
            <div class="form-group" ng-if="info.workTypeId">
                <label class="col-sm-2 control-label">处理流程：</label>
                <div class="col-sm-10">
                    <span >{{info.dealProcessName}}</span>
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-2 control-label"><i ng-if="shoushuaFlag" class="red_req">*</i>关联商户：</label>
                <div class="col-sm-2">
                    <select name="autocomplete-select" id="autocomplete-select2" ng-model="info.merchantNo" chosen-data="merchantList" ng-required="shoushuaFlag"
                            ng-options="x.value as x.text for x in merchantList" ng-change="merchantChange()" style="width: 140%" chosen  chosen-keyup="getMerchantList">
                    </select>
                </div>
                <div class="req_mesg" ng-show="horizontal.merchantNo.$dirty && horizontal.merchantNo.$invalid">
                    <span ng-show="horizontal.merchantNo.$error.required">关联商户不能为空</span>
                </div>
            </div>
            <div class="form-group" ng-if="shoushuaFlag" >
                <label class="col-sm-2 control-label">直属代理商：</label>
                <div class="col-sm-4 checkbox" ng-show="(showAgentName!=null && showAgentName!='') ||  (showAgentName!=null && showAgentName!='')"  ng-bind="showAgentName+'('+showAgentNo+')'">
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-2 control-label"><i class="red_req">*</i>接收代理商：</label>
                <div class="col-sm-2">
                    <select name="autocomplete-select" id="autocomplete-select" ng-model="info.receiveAgentNode" chosen-data="agentList" required
                            ng-options="x.value as x.text for x in agentList" style="width: 100%" chosen  chosen-keyup="getAgentList">
                    </select>
                </div>
                <div class="req_mesg" ng-show="horizontal.receiveAgentNode.$dirty && horizontal.receiveAgentNode.$invalid">
                    <span ng-show="horizontal.receiveAgentNode.$error.required">接收代理商不能为空</span>
                </div>
            </div>
            <div class="form-group" ng-if="shoushuaFlag" >
                <label class="col-sm-2 control-label"><i class="red_req">*</i>来源部门：</label>
                <div class="col-sm-2">
                    <select class="form-control" name="sourceDeptNo"  required ng-model="info.sourceDeptNo"  ng-options="x.value as x.text for x in sourceDept"/>
                </div>
                <div class="req_mesg" ng-show="horizontal.sourceDeptNo.$dirty && horizontal.sourceDeptNo.$invalid">
                    <span ng-show="horizontal.sourceDeptNo.$error.required">来源部门不能为空</span>
                </div>
            </div>
            <div class="form-group" ng-if="shoushuaFlag" >
                <label class="col-sm-2 control-label"><i class="red_req">*</i>投诉人：</label>
                <div class="col-sm-2">
                    <input type="text" class="form-control"  name="complainant" placeholder="请输入投诉人" required ng-model="info.complainant" maxlength="20">
                </div>
                <div class="req_mesg" ng-show="horizontal.complainant.$dirty && horizontal.complainant.$invalid">
                    <span ng-show="horizontal.complainant.$error.required">投诉人不能为空</span>
                </div>
            </div>
            <div class="form-group" ng-if="shoushuaFlag" >
                <label class="col-sm-2 control-label"><i class="red_req">*</i>联系电话：</label>
                <div class="col-sm-2">
                        <input type="text" class="form-control"  name="merchantMobilephone" placeholder="请输入联系电话" required ng-model="info.merchantMobilephone" maxlength="20">
                    </select>
                </div>
                <div class="req_mesg" ng-show="horizontal.merchantMobilephone.$dirty && horizontal.merchantMobilephone.$invalid">
                    <span ng-show="horizontal.merchantMobilephone.$error.required">联系电话不能为空</span>
                </div>
            </div>
            <div class="form-group" >
                <label class="col-sm-2 control-label" >是否加急：</label>
                <div class="col-sm-6" style="width: 400px;">
                    <select class="form-control" ng-model="info.urgeStatus" name="urgeStatus"  ng-options="x.value as x.text for x in urgeStatusSelect"/>
                </div>
            </div>
            <div class="form-group" ng-if="info.urgeStatus == 1">
                <label class="col-sm-2 control-label" ><i class="red_req">*</i>截止回复：</label>
                <div class="col-sm-6" style="width: 400px;">
                    <select class="form-control" ng-model="info.endReplyDays" name="endReplyDays" required  ng-options="x.value as x.text for x in endReplyDaysSelect"/>
                </div>
                <div class="req_mesg" ng-show="horizontal.endReplyDays.$dirty && horizontal.endReplyDays.$invalid">
                    <span ng-show="horizontal.endReplyDays.$error.required">截止回复不能为空</span>
                </div>
            </div>
            <div class="form-group" >
                <label class="col-sm-2 control-label" ><i class="red_req">*</i>工单内容：</label>
                <div class="col-lg-8">
                    <summernote type="text" required config="summeroptions" id="summernote" class="form-control" name="desc"  ng-model="info.workContent" editable="editable" editor="editor" >
                    </summernote>
                </div>
                <div class="req_mesg" ng-show="horizontal.workContent.$dirty && horizontal.workContent.$invalid">
                    <span ng-show="horizontal.workContent.$error.required">工单内容不能为空</span>
                </div>
            </div>
            <div class="form-group" >
                <label class="col-sm-2 control-label" style="float: left;">添加附件：</label>
                <div class="col-sm-3 checkbox ">
                    <input type="file" nv-file-select="" ng-model="fileSelect" uploader="uploader" multiple/>
                    <table class="table">
                        <tbody>
                        <tr ng-repeat="item in uploader.queue">
                            <td>
                                <strong>{{ item.file.name }}</strong>
                            </td>
                            <td nowrap>
                                <button type="button" class="btn btn-danger btn-xs" ng-click="item.remove()">
                                    <span class="glyphicon glyphicon-trash"></span>删除
                                </button>
                            </td>
                        </tr>
                        </tbody>
                    </table>
                </div>
                <label style="margin-top:7px;color: red">注:最多可上传15个文件,每个文件小于10M</label>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label"></label>
                <div class="col-sm-6">
                    <button ng-disabled="horizontal.$invalid || submitting" class="btn btn-primary" type="button" ng-click='commitInfo()'>提交</button>
                    <button class="btn btn-primary8" type="button" ui-sref="workOrder.workOrderManager" >返回</button>
                </div>
            </div>
        </div>
    </form>

</div>

